/*
 * DailyQuotationActivity.java
 * business
 *
 * Created by ChenTao on 2017/6/5.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.dailyquotation;

import android.app.Activity;
import android.content.Intent;

import com.yidiandao.business.R;
import com.yidiandao.business.base.BaseActivity;
import com.yidiandao.business.utils.ActivityUtils;

/**
 * 每日行情
 * <p>
 * Created by ChenTao(chentao7v@gmail.com) on 2017-06-05 9:42
 */
public class DailyQuotationActivity extends BaseActivity {

    private DailyQuotationFragment mQuotationFragment;

    public static void actionStart(Activity activity) {
        Intent intent = new Intent(activity, DailyQuotationActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void initFragment() {
        mQuotationFragment = (DailyQuotationFragment) getSupportFragmentManager().findFragmentById(R.id.container_daily_quotation);
        if (mQuotationFragment == null) {
            mQuotationFragment = DailyQuotationFragment.newInstance();
            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(), mQuotationFragment, R.id.container_daily_quotation);
        }
    }

    @Override
    protected void initPresenter() {
        new DailyQuotationPresenter(mQuotationFragment);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_daily_quotation;
    }
}
